<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>会员任务 - 社交平台</title>
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
    <style>
        :root {
            --primary: #4361EE;
            --primary-light: #E6EFFF;
            --secondary: #FF6B35;
            --secondary-light: #FFEFE8;
            --success: #2A9D8F;
            --success-light: #E6F4F1;
            --warning: #F4A261;
            --warning-light: #FEF3E6;
            --dark: #1D3557;
            --light: #F8F9FA;
            --gray: #6C757D;
            --border: #DEE2E6;
            --shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
            --shadow-hover: 0 10px 15px rgba(0, 0, 0, 0.1);
        }
        
        body {
            font-family: 'Inter', system-ui, -apple-system, sans-serif;
            background-color: #F5F7FA;
            color: var(--dark);
            line-height: 1.6;
        }
        
        .container {
            max-width: 1140px;
        }
        
        /* 导航栏样式 */
        .navbar {
            background-color: white;
            box-shadow: var(--shadow);
            padding: 0.75rem 1rem;
        }
        
        .navbar-brand {
            font-weight: 700;
            color: var(--primary);
            font-size: 1.5rem;
        }
        
        .nav-link {
            color: var(--dark);
            margin-left: 1rem;
            font-weight: 500;
            transition: color 0.2s;
        }
        
        .nav-link:hover, .nav-link.active {
            color: var(--primary);
        }
        
        /* 用户信息卡片 */
        .user-profile-card {
            background-color: white;
            border-radius: 12px;
            box-shadow: var(--shadow);
            padding: 1.5rem;
            margin-bottom: 1.5rem;
        }
        
        .user-header {
            display: flex;
            align-items: center;
            gap: 1.25rem;
            margin-bottom: 1rem;
        }
        
        .user-avatar {
            width: 80px;
            height: 80px;
            border-radius: 50%;
            object-fit: cover;
            border: 3px solid var(--primary-light);
        }
        
        .user-info h3 {
            font-size: 1.25rem;
            font-weight: 600;
            margin-bottom: 0.25rem;
        }
        
        .member-badge {
            display: inline-block;
            padding: 0.25rem 0.75rem;
            background-color: var(--primary-light);
            color: var(--primary);
            border-radius: 20px;
            font-size: 0.85rem;
            font-weight: 500;
        }
        
        .user-stats {
            display: flex;
            justify-content: space-between;
            margin-top: 1rem;
            padding-top: 1rem;
            border-top: 1px solid var(--border);
        }
        
        .stat-item {
            text-align: center;
            flex: 1;
        }
        
        .stat-value {
            font-size: 1.5rem;
            font-weight: 700;
            color: var(--primary);
        }
        
        .stat-label {
            font-size: 0.85rem;
            color: var(--gray);
        }
        
        /* 任务页面标题 */
        .page-header {
            margin: 2rem 0;
        }
        
        .page-title {
            font-size: 1.75rem;
            font-weight: 700;
            margin-bottom: 0.5rem;
        }
        
        .page-description {
            color: var(--gray);
            max-width: 700px;
        }
        
        /* 任务筛选标签 */
        .task-filters {
            display: flex;
            flex-wrap: wrap;
            gap: 0.75rem;
            margin-bottom: 2rem;
            padding-bottom: 1rem;
            border-bottom: 1px solid var(--border);
        }
        
        .filter-tag {
            padding: 0.5rem 1.25rem;
            border-radius: 20px;
            font-size: 0.9rem;
            cursor: pointer;
            transition: all 0.2s;
            border: 1px solid transparent;
        }
        
        .filter-tag.active {
            background-color: var(--primary);
            color: white;
        }
        
        .filter-tag:not(.active) {
            background-color: white;
            color: var(--gray);
            border-color: var(--border);
        }
        
        .filter-tag:not(.active):hover {
            border-color: var(--primary);
            color: var(--primary);
        }
        
        /* 任务列表 */
        .tasks-container {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
            gap: 1.5rem;
            margin-bottom: 3rem;
        }
        
        /* 任务卡片通用样式 */
        .task-card {
            background-color: white;
            border-radius: 12px;
            box-shadow: var(--shadow);
            overflow: hidden;
            transition: transform 0.2s, box-shadow 0.2s;
            display: flex;
            flex-direction: column;
        }
        
        .task-card:hover {
            transform: translateY(-5px);
            box-shadow: var(--shadow-hover);
        }
        
        .task-header {
            padding: 1.25rem;
            border-bottom: 1px solid var(--border);
            display: flex;
            justify-content: space-between;
            align-items: center;
        }
        
        .task-type {
            font-size: 0.85rem;
            font-weight: 500;
            padding: 0.25rem 0.75rem;
            border-radius: 20px;
        }
        
        .task-type.daily {
            background-color: var(--primary-light);
            color: var(--primary);
        }
        
        .task-type.weekly {
            background-color: var(--secondary-light);
            color: var(--secondary);
        }
        
        .task-type.monthly {
            background-color: var(--success-light);
            color: var(--success);
        }
        
        .task-type.special {
            background-color: var(--warning-light);
            color: var(--warning);
        }
        
        .task-reward {
            display: flex;
            align-items: center;
            gap: 5px;
            font-size: 0.9rem;
            font-weight: 500;
            color: var(--success);
        }
        
        .task-body {
            padding: 1.25rem;
            flex: 1;
        }
        
        .task-title {
            font-size: 1.1rem;
            font-weight: 600;
            margin-bottom: 0.75rem;
        }
        
        .task-description {
            font-size: 0.9rem;
            color: var(--gray);
            margin-bottom: 1rem;
            line-height: 1.5;
        }
        
        .task-progress {
            margin-bottom: 1.25rem;
        }
        
        .progress-label {
            display: flex;
            justify-content: space-between;
            font-size: 0.85rem;
            margin-bottom: 0.5rem;
        }
        
        .progress-bar-container {
            height: 8px;
            background-color: #E9ECEF;
            border-radius: 4px;
            overflow: hidden;
        }
        
        .progress-bar {
            height: 100%;
            border-radius: 4px;
            transition: width 0.3s ease;
        }
        
        .progress-bar.primary {
            background-color: var(--primary);
        }
        
        .progress-bar.secondary {
            background-color: var(--secondary);
        }
        
        .progress-bar.success {
            background-color: var(--success);
        }
        
        .task-footer {
            padding: 1rem 1.25rem;
            border-top: 1px solid var(--border);
            display: flex;
            justify-content: space-between;
        }
        
        .task-action {
            padding: 0.5rem 1.25rem;
            border-radius: 6px;
            font-size: 0.9rem;
            font-weight: 500;
            cursor: pointer;
            transition: all 0.2s;
            border: none;
        }
        
        .task-action.primary {
            background-color: var(--primary);
            color: white;
        }
        
        .task-action.primary:hover {
            background-color: #3A56D4;
        }
        
        .task-action.secondary {
            background-color: white;
            color: var(--primary);
            border: 1px solid var(--primary);
        }
        
        .task-action.secondary:hover {
            background-color: var(--primary-light);
        }
        
        .task-action.disabled {
            background-color: #E9ECEF;
            color: var(--gray);
            cursor: not-allowed;
        }
        
        /* 连续打卡样式 */
        .check-in-streak {
            background-color: var(--primary-light);
            border-radius: 12px;
            padding: 1.5rem;
            margin-bottom: 2rem;
            text-align: center;
        }
        
        .streak-icon {
            font-size: 2.5rem;
            color: var(--primary);
            margin-bottom: 1rem;
        }
        
        .streak-title {
            font-size: 1.25rem;
            font-weight: 600;
            margin-bottom: 0.5rem;
        }
        
        .streak-description {
            color: var(--gray);
            margin-bottom: 1.25rem;
        }
        
        .check-in-calendar {
            display: flex;
            justify-content: center;
            gap: 0.5rem;
            margin-bottom: 1.25rem;
        }
        
        .calendar-day {
            width: 36px;
            height: 36px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 0.85rem;
            font-weight: 500;
        }
        
        .calendar-day.past {
            background-color: var(--primary);
            color: white;
        }
        
        .calendar-day.today {
            background-color: white;
            color: var(--primary);
            border: 2px solid var(--primary);
        }
        
        .calendar-day.future {
            background-color: #E9ECEF;
            color: var(--gray);
        }
        
        /* 任务成就 */
        .achievements-section {
            margin-top: 3rem;
        }
        
        .section-title {
            font-size: 1.5rem;
            font-weight: 600;
            margin-bottom: 1.5rem;
            display: flex;
            align-items: center;
            gap: 0.5rem;
        }
        
        .section-title i {
            color: var(--primary);
        }
        
        .achievements-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
            gap: 1.5rem;
        }
        
        .achievement-item {
            background-color: white;
            border-radius: 12px;
            padding: 1.25rem;
            text-align: center;
            box-shadow: var(--shadow);
            transition: transform 0.2s;
        }
        
        .achievement-item:hover {
            transform: translateY(-3px);
        }
        
        .achievement-icon {
            width: 60px;
            height: 60px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            margin: 0 auto 1rem;
            font-size: 1.5rem;
        }
        
        .achievement-icon.unlocked {
            background-color: var(--primary-light);
            color: var(--primary);
        }
        
        .achievement-icon.locked {
            background-color: #E9ECEF;
            color: var(--gray);
        }
        
        .achievement-title {
            font-weight: 600;
            font-size: 1rem;
            margin-bottom: 0.5rem;
        }
        
        .achievement-desc {
            font-size: 0.85rem;
            color: var(--gray);
            margin-bottom: 0.75rem;
        }
        
        .achievement-status {
            font-size: 0.8rem;
            padding: 0.2rem 0.75rem;
            border-radius: 20px;
        }
        
        .achievement-status.unlocked {
            background-color: var(--success-light);
            color: var(--success);
        }
        
        .achievement-status.locked {
            background-color: #E9ECEF;
            color: var(--gray);
        }
        
        /* 响应式调整 */
        @media (max-width: 992px) {
            .tasks-container {
                grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
            }
        }
        
        @media (max-width: 768px) {
            .tasks-container {
                grid-template-columns: 1fr;
            }
            
            .achievements-grid {
                grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
            }
            
            .user-stats {
                flex-wrap: wrap;
            }
            
            .stat-item {
                flex: 1 0 50%;
                margin-bottom: 1rem;
            }
            
            .stat-item:last-child, .stat-item:nth-last-child(2) {
                margin-bottom: 0;
            }
        }
        
        @media (max-width: 576px) {
            .task-filters {
                gap: 0.5rem;
            }
            
            .filter-tag {
                padding: 0.4rem 0.8rem;
                font-size: 0.85rem;
            }
            
            .task-footer {
                flex-direction: column;
                gap: 0.75rem;
            }
            
            .task-action {
                width: 100%;
            }
            
            .check-in-calendar {
                flex-wrap: wrap;
                justify-content: flex-start;
            }
        }
    </style>
</head>
<body>
    <!-- 导航栏 -->
    <nav class="navbar navbar-expand-lg">
        <div class="container">
            <a class="navbar-brand" href="#">社交平台</a>
            
            <div class="collapse navbar-collapse" id="navbarNav">
                <ul class="navbar-nav ms-auto">
                    <li class="nav-item">
                        <a class="nav-link" href="#"><i class="fas fa-home me-1"></i> 首页</a>
                    </li>
                    <li class="nav-item">
                        <a class="nav-link" href="#"><i class="fas fa-compass me-1"></i> 发现</a>
                    </li>
                    <li class="nav-item">
                        <a class="nav-link active" aria-current="page" href="#"><i class="fas fa-tasks me-1"></i> 任务</a>
                    </li>
                    <li class="nav-item">
                        <a class="nav-link" href="#"><i class="fas fa-shopping-bag me-1"></i> 商城</a>
                    </li>
                    <li class="nav-item">
                        <a class="nav-link" href="#"><i class="far fa-user me-1"></i> 我的</a>
                    </li>
                </ul>
            </div>
        </div>
    </nav>
    
    <div class="container py-5">
        <div class="row">
            <!-- 侧边栏：用户信息 -->
            <div class="col-lg-3">
                <div class="user-profile-card">
                    <div class="user-header">
                        <img src="https://picsum.photos/200/200?random=1" alt="用户头像" class="user-avatar">
                        <div class="user-info">
                            <h3>星辰大海</h3>
                            <span class="member-badge">黄金会员</span>
                        </div>
                    </div>
                    
                    <div class="user-stats">
                        <div class="stat-item">
                            <div class="stat-value">1280</div>
                            <div class="stat-label">积分</div>
                        </div>
                        <div class="stat-item">
                            <div class="stat-value">7</div>
                            <div class="stat-label">连续打卡</div>
                        </div>
                        <div class="stat-item">
                            <div class="stat-value">15</div>
                            <div class="stat-label">已完成任务</div>
                        </div>
                        <div class="stat-item">
                            <div class="stat-value">8</div>
                            <div class="stat-label">获得成就</div>
                        </div>
                    </div>
                </div>
                
                <!-- 连续打卡 -->
                <div class="check-in-streak">
                    <div class="streak-icon">
                        <i class="fas fa-fire"></i>
                    </div>
                    <h4 class="streak-title">连续打卡 7 天</h4>
                    <p class="streak-description">再坚持 3 天，可获得 50 积分奖励</p>
                    
                    <div class="check-in-calendar">
                        <div class="calendar-day past">一</div>
                        <div class="calendar-day past">二</div>
                        <div class="calendar-day past">三</div>
                        <div class="calendar-day past">四</div>
                        <div class="calendar-day past">五</div>
                        <div class="calendar-day past">六</div>
                        <div class="calendar-day today">日</div>
                        <div class="calendar-day future">一</div>
                        <div class="calendar-day future">二</div>
                        <div class="calendar-day future">三</div>
                    </div>
                    
                    <button class="task-action primary">今日打卡</button>
                </div>
            </div>
            
            <!-- 主内容区：任务列表 -->
            <div class="col-lg-9">
                <div class="page-header">
                    <h2 class="page-title">会员任务中心</h2>
                    <p class="page-description">完成任务获取积分，积分可兑换丰富奖励，提升会员等级享受更多特权</p>
                </div>
                
                <!-- 任务筛选 -->
                <div class="task-filters">
                    <div class="filter-tag active">全部任务</div>
                    <div class="filter-tag">日常任务</div>
                    <div class="filter-tag">每周任务</div>
                    <div class="filter-tag">月度任务</div>
                    <div class="filter-tag">特殊任务</div>
                    <div class="filter-tag">已完成</div>
                </div>
                
                <!-- 任务列表 -->
                <div class="tasks-container">
                    <!-- 日常任务1 -->
                    <div class="task-card">
                        <div class="task-header">
                            <span class="task-type daily">日常任务</span>
                            <div class="task-reward">
                                <i class="fas fa-coins"></i>
                                <span>20 积分</span>
                            </div>
                        </div>
                        <div class="task-body">
                            <h3 class="task-title">每日签到</h3>
                            <p class="task-description">每天登录并完成签到，连续签到可获得额外奖励</p>
                            <div class="task-progress">
                                <div class="progress-label">
                                    <span>完成进度</span>
                                    <span>1/1</span>
                                </div>
                                <div class="progress-bar-container">
                                    <div class="progress-bar primary" style="width: 100%;"></div>
                                </div>
                            </div>
                        </div>
                        <div class="task-footer">
                            <button class="task-action disabled">已完成</button>
                        </div>
                    </div>
                    
                    <!-- 日常任务2 -->
                    <div class="task-card">
                        <div class="task-header">
                            <span class="task-type daily">日常任务</span>
                            <div class="task-reward">
                                <i class="fas fa-coins"></i>
                                <span>15 积分</span>
                            </div>
                        </div>
                        <div class="task-body">
                            <h3 class="task-title">发布一条动态</h3>
                            <p class="task-description">分享你的生活点滴或想法，发布一条公开动态</p>
                            <div class="task-progress">
                                <div class="progress-label">
                                    <span>完成进度</span>
                                    <span>0/1</span>
                                </div>
                                <div class="progress-bar-container">
                                    <div class="progress-bar primary" style="width: 0%;"></div>
                                </div>
                            </div>
                        </div>
                        <div class="task-footer">
                            <button class="task-action primary">去完成</button>
                        </div>
                    </div>
                    
                    <!-- 日常任务3 -->
                    <div class="task-card">
                        <div class="task-header">
                            <span class="task-type daily">日常任务</span>
                            <div class="task-reward">
                                <i class="fas fa-coins"></i>
                                <span>10 积分</span>
                            </div>
                        </div>
                        <div class="task-body">
                            <h3 class="task-title">评论3条动态</h3>
                            <p class="task-description">参与社区互动，评论3条他人发布的动态</p>
                            <div class="task-progress">
                                <div class="progress-label">
                                    <span>完成进度</span>
                                    <span>1/3</span>
                                </div>
                                <div class="progress-bar-container">
                                    <div class="progress-bar primary" style="width: 33%;"></div>
                                </div>
                            </div>
                        </div>
                        <div class="task-footer">
                            <button class="task-action primary">继续完成</button>
                        </div>
                    </div>
                    
                    <!-- 每周任务1 -->
                    <div class="task-card">
                        <div class="task-header">
                            <span class="task-type weekly">每周任务</span>
                            <div class="task-reward">
                                <i class="fas fa-coins"></i>
                                <span>100 积分</span>
                            </div>
                        </div>
                        <div class="task-body">
                            <h3 class="task-title">关注5位新用户</h3>
                            <p class="task-description">拓展你的社交圈，关注5位你感兴趣的新用户</p>
                            <div class="progress-label">
                                <span>完成进度</span>
                                <span>3/5</span>
                            </div>
                            <div class="progress-bar-container">
                                <div class="progress-bar secondary" style="width: 60%;"></div>
                            </div>
                        </div>
                        <div class="task-footer">
                            <button class="task-action primary">继续完成</button>
                        </div>
                    </div>
                    
                    <!-- 每周任务2 -->
                    <div class="task-card">
                        <div class="task-header">
                            <span class="task-type weekly">每周任务</span>
                            <div class="task-reward">
                                <i class="fas fa-coins"></i>
                                <span>150 积分</span>
                            </div>
                        </div>
                        <div class="task-body">
                            <h3 class="task-title">动态获得20个赞</h3>
                            <p class="task-description">发布优质内容，让你的动态获得20个点赞</p>
                            <div class="progress-label">
                                <span>完成进度</span>
                                <span>8/20</span>
                            </div>
                            <div class="progress-bar-container">
                                <div class="progress-bar secondary" style="width: 40%;"></div>
                            </div>
                        </div>
                        <div class="task-footer">
                            <button class="task-action secondary">查看我的动态</button>
                            <button class="task-action primary">去完成</button>
                        </div>
                    </div>
                    
                    <!-- 月度任务 -->
                    <div class="task-card">
                        <div class="task-header">
                            <span class="task-type monthly">月度任务</span>
                            <div class="task-reward">
                                <i class="fas fa-coins"></i>
                                <span>500 积分</span>
                            </div>
                        </div>
                        <div class="task-body">
                            <h3 class="task-title">发布15条优质动态</h3>
                            <p class="task-description">每月发布15条原创优质动态，内容需积极健康</p>
                            <div class="progress-label">
                                <span>完成进度</span>
                                <span>7/15</span>
                            </div>
                            <div class="progress-bar-container">
                                <div class="progress-bar success" style="width: 47%;"></div>
                            </div>
                        </div>
                        <div class="task-footer">
                            <button class="task-action primary">继续完成</button>
                        </div>
                    </div>
                    
                    <!-- 特殊任务1 -->
                    <div class="task-card">
                        <div class="task-header">
                            <span class="task-type special">特殊任务</span>
                            <div class="task-reward">
                                <i class="fas fa-coins"></i>
                                <span>300 积分</span>
                            </div>
                        </div>
                        <div class="task-body">
                            <h3 class="task-title">完善个人资料</h3>
                            <p class="task-description">上传头像、填写个人简介、设置兴趣标签，完善你的个人资料</p>
                            <div class="progress-label">
                                <span>完成进度</span>
                                <span>2/3</span>
                            </div>
                            <div class="progress-bar-container">
                                <div class="progress-bar warning" style="width: 67%;"></div>
                            </div>
                        </div>
                        <div class="task-footer">
                            <button class="task-action primary">去完成</button>
                        </div>
                    </div>
                    
                    <!-- 特殊任务2 -->
                    <div class="task-card">
                        <div class="task-header">
                            <span class="task-type special">特殊任务</span>
                            <div class="task-reward">
                                <i class="fas fa-coins"></i>
                                <span>200 积分</span>
                                <i class="fas fa-gift ms-1"></i>
                                <span>专属徽章</span>
                            </div>
                        </div>
                        <div class="task-body">
                            <h3 class="task-title">邀请好友注册</h3>
                            <p class="task-description">成功邀请3位好友注册并完成新手任务</p>
                            <div class="progress-label">
                                <span>完成进度</span>
                                <span>0/3</span>
                            </div>
                            <div class="progress-bar-container">
                                <div class="progress-bar warning" style="width: 0%;"></div>
                            </div>
                        </div>
                        <div class="task-footer">
                            <button class="task-action secondary">复制邀请链接</button>
                            <button class="task-action primary">去邀请</button>
                        </div>
                    </div>
                </div>
                
                <!-- 任务成就 -->
                <div class="achievements-section">
                    <h3 class="section-title">
                        <i class="fas fa-trophy"></i>
                        我的成就
                    </h3>
                    
                    <div class="achievements-grid">
                        <!-- 已解锁成就 -->
                        <div class="achievement-item">
                            <div class="achievement-icon unlocked">
                                <i class="fas fa-pencil-alt"></i>
                            </div>
                            <h4 class="achievement-title">初露锋芒</h4>
                            <p class="achievement-desc">发布第一条动态</p>
                            <span class="achievement-status unlocked">已解锁</span>
                        </div>
                        
                        <div class="achievement-item">
                            <div class="achievement-icon unlocked">
                                <i class="fas fa-comments"></i>
                            </div>
                            <h4 class="achievement-title">社交达人</h4>
                            <p class="achievement-desc">累计发表50条评论</p>
                            <span class="achievement-status unlocked">已解锁</span>
                        </div>
                        
                        <div class="achievement-item">
                            <div class="achievement-icon unlocked">
                                <i class="fas fa-heart"></i>
                            </div>
                            <h4 class="achievement-title">人气之星</h4>
                            <p class="achievement-desc">单条动态获得100个赞</p>
                            <span class="achievement-status unlocked">已解锁</span>
                        </div>
                        
                        <div class="achievement-item">
                            <div class="achievement-icon unlocked">
                                <i class="fas fa-calendar-check"></i>
                            </div>
                            <h4 class="achievement-title">坚持不懈</h4>
                            <p class="achievement-desc">连续签到30天</p>
                            <span class="achievement-status unlocked">已解锁</span>
                        </div>
                        
                        <!-- 未解锁成就 -->
                        <div class="achievement-item">
                            <div class="achievement-icon locked">
                                <i class="fas fa-users"></i>
                            </div>
                            <h4 class="achievement-title">万人迷</h4>
                            <p class="achievement-desc">获得1000位粉丝</p>
                            <span class="achievement-status locked">500/1000</span>
                        </div>
                        
                        <div class="achievement-item">
                            <div class="achievement-icon locked">
                                <i class="fas fa-image"></i>
                            </div>
                            <h4 class="achievement-title">摄影大师</h4>
                            <p class="achievement-desc">发布50张原创图片</p>
                            <span class="achievement-status locked">23/50</span>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>

    <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
    <script>
        // 筛选标签切换
        document.querySelectorAll('.filter-tag').forEach(tag => {
            tag.addEventListener('click', function() {
                // 移除所有标签的active类
                document.querySelectorAll('.filter-tag').forEach(t => {
                    t.classList.remove('active');
                });
                // 给当前点击的标签添加active类
                this.classList.add('active');
                
                // 这里可以添加筛选任务的逻辑
                const filterType = this.textContent;
                console.log('筛选类型: ' + filterType);
            });
        });
        
        // 任务按钮点击事件
        document.querySelectorAll('.task-action.primary:not(.disabled)').forEach(btn => {
            btn.addEventListener('click', function() {
                const taskCard = this.closest('.task-card');
                const taskTitle = taskCard.querySelector('.task-title').textContent;
                
                // 如果是"去完成"或"继续完成"按钮
                if (this.textContent.includes('完成')) {
                    // 模拟任务完成
                    if (taskTitle === '评论3条动态' || taskTitle === '关注5位新用户' || taskTitle === '动态获得20个赞' || taskTitle === '发布15条优质动态') {
                        // 这些任务需要多次操作，只更新进度
                        const progressText = taskCard.querySelector('.progress-label span:last-child').textContent;
                        const [current, total] = progressText.split('/').map(Number);
                        
                        // 随机增加1-2的进度
                        const newCurrent = Math.min(current + Math.floor(Math.random() * 2) + 1, total);
                        const progressPercent = (newCurrent / total) * 100;
                        
                        taskCard.querySelector('.progress-label span:last-child').textContent = `${newCurrent}/${total}`;
                        taskCard.querySelector('.progress-bar').style.width = `${progressPercent}%`;
                        
                        // 如果完成了任务
                        if (newCurrent === total) {
                            this.textContent = '领取奖励';
                        }
                    } else {
                        // 一次性完成的任务
                        taskCard.querySelector('.progress-label span:last-child').textContent = '1/1';
                        taskCard.querySelector('.progress-bar').style.width = '100%';
                        this.textContent = '领取奖励';
                    }
                } 
                // 如果是"领取奖励"按钮
                else if (this.textContent === '领取奖励') {
                    const rewardText = taskCard.querySelector('.task-reward span').textContent;
                    alert(`恭喜！你已完成任务"${taskTitle}"，获得奖励：${rewardText}`);
                    
                    // 更新为已完成状态
                    this.textContent = '已完成';
                    this.classList.add('disabled');
                    this.classList.remove('primary');
                }
            });
        });
        
        // 今日打卡按钮
        document.querySelector('.check-in-streak .task-action').addEventListener('click', function() {
            alert('今日打卡成功！获得20积分奖励');
            this.textContent = '已打卡';
            this.classList.add('disabled');
            this.classList.remove('primary');
        });
        
        // 复制邀请链接按钮
        document.querySelector('.task-action.secondary').addEventListener('click', function() {
            // 模拟复制到剪贴板
            navigator.clipboard.writeText('https://socialplatform.com/invite?code=ABC123')
                .then(() => {
                    alert('邀请链接已复制到剪贴板');
                })
                .catch(err => {
                    console.error('无法复制内容: ', err);
                });
        });
    </script>
</body>
</html>
    
